package com.network.demo.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.network.demo.pojo.ErrorInfo;
import com.network.demo.pojo.NetWorkVO;
import com.network.demo.service.NetWorkService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.GetMapping;


@RestController
@RequestMapping("/network")
public class NetWorkController {
    @Autowired
    private NetWorkService netWorkService;

    /**
     * 接受网络信息
     * @param message 网络信息
     * @return 处理结果
     */
    @PostMapping("/receive")
    public ErrorInfo NetWorkReceive(@RequestBody NetWorkVO netWorkVO) {
        return netWorkService.NetWorkReceive(netWorkVO);
    }

    @GetMapping("/test")
    public String getMethodName() {
        return new String("123");
    }
    
    
}
